import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '订单状态',
		align: "center",
		dataIndex: 'orderStatus_dictText'
	},
	{
		title: '商品',
		align: "center",
		dataIndex: 'pdtId_dictText'
	},
	{
		title: '金额',
		align: "center",
		sorter: true,
		dataIndex: 'price'
	},
	{
		title: '产品商家',
		align: "center",
		sorter: true,
		dataIndex: 'shopId_dictText'
	},
	{
		title: '下单用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '核销状态',
		align: "center",
		dataIndex: 'chargeOffStatus_dictText'
	},
	{
		title: '核销员',
		align: "center",
		dataIndex: 'chargeOffUser_dictText'
	},
	{
		title: '过期时间',
		align: "center",
		dataIndex: 'expirationTime'
	},
	{
		title: '核销时间',
		align: "center",
		dataIndex: 'chargeOffTime'
	},
];
//查询数据
export const searchFormSchema : FormSchema[] = [
	{
		label: "订单状态",
		field: 'orderStatus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "sys_category,name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "商品",
		field: 'pdtId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_shop_pdt,title,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "下单用户",
		field: 'userId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,nick_name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "核销状态",
		field: 'chargeOffStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sys_category,name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "核销用户",
		field: 'chargeOffUser',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,nick_name,id"
		},
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "sys_category,name,id"
		},
	},
	{
		label: '过期时间',
		field: 'expirationTime',
		component: 'DatePicker',
		componentProps: {
			showTime: true,
			valueFormat: 'YYYY-MM-DD HH:mm:ss'
		},
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}